/*
* pps_bom
*/
package com.pitop.project.api;

import com.pitop.project.entity.ProjectCategory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 项目分类 api请求熔断器
 *
 * @author berton
 */
@FeignClient(value = "pps-cloud-provider", fallback = ProjectCategoryFeignApiImpl.class)
public interface ProjectCategoryFeignApi {
    /**
     * 查询ProjectCategory一个详情信息
     *
     * @param id   id
     * @param code 编码
     * @return ProjectCategory
     */
    @GetMapping(value = "/projectCategory/load")
    ProjectCategory load(@RequestParam("id") Long id, @RequestParam("code") String code);


    /**
     * 根据条件id查询ProjectCategory一个详情信息
     *
     * @param id id
     * @return ProjectCategory
     */
    @GetMapping(value = "/projectCategory/load/id/{id}")
    ProjectCategory loadById(@RequestParam("id") Long id);

    /**
     * 根据条件code查询ProjectCategory一个详情信息
     *
     * @param code 编码
     * @return ProjectCategory
     */
    @GetMapping(value = "/projectCategory/load/code/{code}")
    ProjectCategory loadByCode(@RequestParam("code") String code);

    /**
     * 根据条件name查询ProjectCategory一个详情信息
     *
     * @param name  项目分类名称
     * @return ProjectCategory
     */
    @GetMapping(value = "/projectCategory/load/name/{name}")
    ProjectCategory loadByName(@RequestParam("name") String name);

    /**
     * 删除ProjectCategory
     */
    @DeleteMapping("/projectCategory/delete")
    void delete(@RequestParam("id") Long id, @RequestParam("code") String code);


    /**
     * 查询ProjectCategory信息集合
     *
     * @return 分页对象
     */
    @PostMapping(value = "/projectCategory/list")
    List<ProjectCategory> list(@RequestBody ProjectCategory projectCategory, @RequestParam("curPage") int curPage, @RequestParam("pageSize") int pageSize);


    /**
     * 查询ProjectCategory信息集合
     *
     * @return 分页对象
     */
    @GetMapping(value = "/projectCategory/list/by")
    List<ProjectCategory> listByPk(@RequestParam("id") Long id, @RequestParam("code") String code, @RequestParam("curPage") int curPage, @RequestParam("pageSize") int pageSize);


    /**
     * 统计ProjectCategory信息数量根据主键
     *
     * @return 总条数
     */
    @GetMapping(value = "/projectCategory/count/by")
    Integer count(@RequestParam("id") Long id, @RequestParam("code") String code);

    /**
     * 统计ProjectCategory信息数量
     *
     * @return 总条数
     */
    @PostMapping(value = "/projectCategory/count")
    Integer count(@RequestBody ProjectCategory projectCategory);


    /**
     * 创建ProjectCategory
     *
     * @return ProjectCategory
     */
    @PostMapping("/projectCategory/build")
    ProjectCategory build(@RequestBody ProjectCategory projectCategory);


    /**
     * 修改ProjectCategory
     *
     * @return ProjectCategory
     */
    @PutMapping("/projectCategory/modify")
    ProjectCategory modify(@RequestBody ProjectCategory projectCategory);


}
